//////////////////////////////////////////////////////////////////////////////////
//
//	client commands
//		- Version 1.2
//		- 04.18.2008
//		- diamond-optic
//
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
//
// - Sets client variables.
//
// Credit:
//
// - Anonymous for the method (cl_dlmax.sma)
//
// Changelog:
//
// - 03.19.2006 Version 1.0
//	Initial release
//
// - 03.27.2006 Version 1.1
//	Added cl_particlefx
//
// - 04.18.2008 Version 1.2
//	Updated public cvar format
//	Added if statement to avoid runtime errors
//
//////////////////////////////////////////////////////////////////////////////////

#include <amxmodx>

#define VERSION "1.2"
#define SVERSION "v1.2 - by diamond-optic (www.AvaMods.com)"

new p_sv_r_decals,p_sv_cl_dlmax,p_sv_cl_timeout,p_sv_cl_particlefx

public plugin_init()
{
	register_plugin("client commands",VERSION,"diamond-optic")
	register_cvar("client_commands_stats",SVERSION,FCVAR_SERVER|FCVAR_SPONLY)
	
	p_sv_r_decals = register_cvar("sv_r_decals","500")
	p_sv_cl_dlmax = register_cvar("sv_cl_dlmax","128")
	p_sv_cl_timeout = register_cvar("sv_cl_timeout","30")
	p_sv_cl_particlefx = register_cvar("sv_cl_particlefx","2")
}
public client_connect(id)
{
	if(!is_user_bot(id) && (is_user_connected(id) || is_user_connecting(id))
		{
		client_cmd(id,"r_decals %d",get_pcvar_num(p_sv_r_decals))
		client_cmd(id,"cl_dlmax %d",get_pcvar_num(p_sv_cl_dlmax))
		client_cmd(id,"cl_timeout %d",get_pcvar_num(p_sv_cl_timeout))
		client_cmd(id,"cl_particlefx %d",get_pcvar_num(p_sv_cl_particlefx))
		}
}
